package musicbox;

import javax.sound.midi.Receiver;
import javax.sound.midi.ShortMessage;

import neuralmusic.brain.module.BasicDelayed;
import neuralmusic.brain.module.BrainException;
import neuralmusic.brain.module.Scheduler;

public class DelayedMessage extends BasicDelayed {

	
	
	private ShortMessage mess;
	private Receiver recv;

	public DelayedMessage(Scheduler sched,ShortMessage mess,Receiver recv) {
		super(sched);
		this.mess=mess;
		this.recv=recv;
	}
	
	@Override
	public void fireImpl(Scheduler sched) throws BrainException {
		recv.send(this.mess,-1);		
	}

}
